package hhm.javamode.memento;

public class Originator {
	// 当前状态
	private String state;

	// 保存到备忘录
	public Memento saveToMemento() {
		return new Memento(state);
	}

	// 返回备忘录状态
	public void restoreFromMemento(Memento memento) {
		this.state = memento.getState();
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
}
